/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "dataset")
@NamedQueries({
    @NamedQuery(name = "Dataset.findAll", query = "SELECT d FROM Dataset d"),
    @NamedQuery(name = "Dataset.findByIddataset", query = "SELECT d FROM Dataset d WHERE d.iddataset = :iddataset"),
    @NamedQuery(name = "Dataset.findByDataset", query = "SELECT d FROM Dataset d WHERE d.dataset = :dataset")})
public class Dataset implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "iddataset")
    private Integer iddataset;
    @Column(name = "dataset")
    private String dataset;
    @OneToMany(mappedBy = "dataset", fetch = FetchType.LAZY)
    private List<Recordlevelelement> recordlevelelementList;

    public Dataset() {
    }

    public Dataset(Integer iddataset) {
        this.iddataset = iddataset;
    }
    public Dataset(Integer iddataset, String dataset) {
        this.iddataset = iddataset;
        this.dataset = dataset;
    }

    public Integer getIddataset() {
        return iddataset;
    }

    public void setIddataset(Integer iddataset) {
        this.iddataset = iddataset;
    }

    public String getDataset() {
        return dataset;
    }

    public void setDataset(String dataset) {
        this.dataset = dataset;
    }

    public List<Recordlevelelement> getRecordlevelelementList() {
        return recordlevelelementList;
    }

    public void setRecordlevelelementList(List<Recordlevelelement> recordlevelelementList) {
        this.recordlevelelementList = recordlevelelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (iddataset != null ? iddataset.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Dataset)) {
            return false;
        }
        Dataset other = (Dataset) object;
        if ((this.iddataset == null && other.iddataset != null) || (this.iddataset != null && !this.iddataset.equals(other.iddataset))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Dataset[iddataset=" + iddataset + "]";
    }

}
